#ifndef  __IDXDIVIDER_H_
#define  __IDXDIVIDER_H_

#include "common.h"
#include "logger.h"
#include "globals.h"
#include "termlist.h"

#define RET_EOF	3

class IdxDivider {
public:
  IdxDivider() {}
  ~IdxDivider() {}

  int load(int level);
  int start_divide(char* fname, int level_num);
  
private:
  void write_index1(idx_index1_t* pindex1);
  void write_index1_last(idx_index1_t* pindex1);
  int  m_level;

  int   m_ofid;
  FILE* m_fp1;
  FILE* m_fp0;
  uint32_t num_links_dump;
  uint64_t tsign_low;

  uint32_t foff_in_index1;
};











#endif  //__IDXDIVIDER_H_
